package com.omt.tarjimdinek.domain.tv.service;

import java.util.List;

import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;

import org.apache.log4j.Logger;

import com.omt.tarjimdinek.domain.tv.dao.ThemeDao;
import com.omt.tarjimdinek.domain.tv.entity.Theme;
import com.omt.tarjimdinek.support.GenericDao;
import com.omt.tarjimdinek.support.RepositoryImpl;

/**
 * Theme manager implements
 * @author chabane
 *
 */
@Named("themeRepository")
@Singleton
public class ThemeRepositoryImpl extends RepositoryImpl<Theme, String> implements ThemeRepository {

	private ThemeDao themeDao; 
	
	@SuppressWarnings("unused")
	private static final Logger log = Logger.getLogger(ThemeRepositoryImpl.class);

	@Inject
	public void setThemeDao(ThemeDao themeDao) {
	   this.themeDao = themeDao;
	}

	/**
	  * Dao getter used by the {@link RepositoryImpl}.
	  */
	@Override
	public GenericDao<Theme, String> getDao() {
	   return themeDao;
	}     
	    
    /**
     * {@inheritDoc}
     */
	public List<Theme> findAll() {
		return themeDao.findAll();
	}

	/**
     * {@inheritDoc}
     */
    @Override
    public Theme getNew() {
        return new Theme();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Theme getNewWithDefaults() {
    	Theme result = getNew();
        result.initDefaultValues();
        return result;
    }

}
